package com.zznj.xzjc.adapter;

import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.zznj.xzjc.R;
import com.zznj.xzjc.net.entity.ZhengJuBean;
import com.zznj.xzjc.utils.FileUtils;

import java.util.List;

import androidx.annotation.Nullable;

/**
 * 描述：适配器
 */
public class ZhengJuListAdapter extends BaseQuickAdapter<ZhengJuBean, BaseViewHolder> {

    public ZhengJuListAdapter(int layoutResId, @Nullable List<ZhengJuBean> data) {
        super(layoutResId, data);
    }
    @Override
    protected void convert(BaseViewHolder helper, ZhengJuBean item) {
        helper.setText(R.id.tv_title,item.getName());
        helper.setText(R.id.tv_size,item.getFileSize());
        ImageView picImg = helper.getView(R.id.picImg);
        picImg.setImageResource(FileUtils.getIcon(item.getFileExt()));
    }
}
